package ar.com.spsolutions.splilabrary.view.application.configuration;

import org.apache.wicket.util.file.Folder;

import ar.com.spsolutions.splilabrary.view.application.SPApplication;

public class UploadConfigurator extends Configurator {

	public UploadConfigurator(final SPApplication application) {
		super(application);
	}

	@Override
	protected void initialize(final SPApplication app) {
		app.getResourceSettings().setThrowExceptionOnMissingResource(false);

		final Folder uploadFolder = new Folder(
				System.getProperty("java.io.tmpdir"), "wicket-uploads");
		// Ensure folder exists
		uploadFolder.mkdirs();
		app.getApplicationSettings().setUploadProgressUpdatesEnabled(true);
	}

}
